<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {:widget_st('layui','css')}
  {:widget_st('bootstrap')}
</head>
{:do_action('admin_head')}
<body>

  <div class="layui-fluid">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-body">
              <form class="layui-form info_tj" onclick="return false;" >
                <input type="hidden" name="special_id" value="{$special_id}">
                <div class="layui-form-item">
                  <label class="layui-form-label">文章:</label>
                  <div class="layui-input-block">
                    <select name="post_id">
                       <?php foreach($post_list as $k=>$vo){ if(!in_array($vo['id'],$check_ids)){ ?>
                      <option value="{$vo['id']}">ID:{$vo['id']}---{$vo['title']}</option>
                      <?php }} ?>
                    </select>
                  </div>
                </div>
                
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <button class="layui-btn" onclick="tijiao_data('/admin/category/special_post_edit')"  lay-submit="" lay-filter="component-form-element">提交</button>
                  </div>
                </div>
              </form>
              <table class="layui-table">
                <colgroup>
                  <col width="30">
                  <col width="160">
                  <col width="50">
                  <col>
                </colgroup>
                <thead>
                  <tr>
                    <th>ID</th>
                    <th>文章</th>          
                    <th>操作</th>
                  </tr> 
                </thead>
                <tbody>
                  <?php foreach($list as $k=>$vo){ ?>
                    <tr>
                      <td>{$vo['id']}</td>
                      <td>{$vo['p_title']}</td>
                      <td>
                        <?php if($vo['status']!=2){ ?>
                        <a class="layui-btn btn_del layui-btn-danger layui-btn-sm" rel="{$vo['id']}" href="#">删除</a> 
                        <?php } ?>
                      </td>
                    </tr>
                  <?php } ?>         
                </tbody>
              </table>
              {$page|raw}

            </div>
          </div>
        </div>
      </div>
    </div>
  {:widget_st('layui','js')}
  {:widget_st('common','js')} 
  <script>
  layui.use([ 'form', 'upload','laydate'], function(){
    var $ = layui.$
    ,form = layui.form
    ,laydate = layui.laydate
    ,upload = layui.upload ;

    // 删除
    $(".btn_del").on("click",function(){
      var id = $(this).attr("rel");
      layer.confirm('确认删除？', {
        btn: ['删除','取消']
      }, function(){
        
        $.get("{:url('admin/common/del_post')}",{id:id,db:'special_post'},function(res){
          if(res.result==1){
            layer.msg("删除成功", {icon: 1});
            setTimeout(function() {
              location.reload(true);
            }, 1000);
          }else{
            layer.msg(res.msg, {icon: 2});
            
          }
        },"json");

      }, function(){
          //取消的操作
      });
    })
    
    
  })
  </script>
</body>
</html>
{:do_action('admin_js')}